package com.zhuss.bean.bo.team.question;

import com.zhuss.bean.unit.team.ChooseBean;
import com.zhuss.common.BaseBo;
import com.zhuss.common.ChooseKey;
import com.zhuss.common.IdBo;
import com.zhuss.util.JsonUtil;

import java.io.Serializable;
import java.util.List;

/**
 * @Author: zhushanshuo
 * @Date: 2020/3/26 13:10
 */
public class CreateQuestionBo extends IdBo implements Serializable, BaseBo{

    private String questionName;

    private List<ChooseBean> questionChoose;

    private Integer investGroup;

    private Integer sort;

    private Integer type;

    private Integer area;

    public String getQuestionName() {
        return questionName;
    }

    public void setQuestionName(String questionName) {
        this.questionName = questionName;
    }

    public String getQuestionChoose() {
        String result = "";
        if (getType() == 10){
            for (int i = 0; i <= questionChoose.size() - 1; i ++) {
                ChooseBean item =  questionChoose.get(i);
                item.setKey(ChooseKey.getKeyList().get(i));
            }
            result = JsonUtil.toJson(questionChoose);
        }else if(getType() == 30){
            result = JsonUtil.toJson(questionChoose);
        }
        return result;
    }

    public void setQuestionChoose(List<ChooseBean> questionChoose) {
        this.questionChoose = questionChoose;
    }

    public Integer getInvestGroup() {
        return investGroup;
    }

    public void setInvestGroup(Integer investGroup) {
        this.investGroup = investGroup;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public Integer getArea() {
        area = getConcurrentArea();
        return area;
    }

    public void setArea(Integer area) {
        this.area = area;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }
}
